#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int m,x,t,l,r,n;
int a[105],b[105];
int main(){
	scanf("%d",&m);
	for(int i=1;i<=m;i++){
		scanf("%d",&a[i]);
	}
	scanf("%d",&t);
	while(t--){
		scanf("%d%d%d",&l,&r,&n);
		for(int i=l;i<=r;i++)
			b[i]=a[i];
		sort(b+l,b+r+1,greater<int>());
		printf("%d\n",*(b+l+n-1));
	}
}
